package com.qianfeng.dbsm.common;

/**
 * @author Chance
 */
public class ResponseData {
    public static final int SUCCESS = 20000;
    public static final int FAIL = 40000;
    Integer code;
    String message;
    Object data;

    public static ResponseData success(String msg,Object data){
        ResponseData rd = new ResponseData();
        rd.setMessage(msg);
        rd.setData(data);
        rd.setCode(SUCCESS);
        return rd;
    }
    public static ResponseData fail(String msg,Object data){
        ResponseData rd = new ResponseData();
        rd.setMessage(msg);
        rd.setData(data);
        rd.setCode(FAIL);
        return rd;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
